package com.woniu.inlet.web.command;

import com.woniu.inlet.web.fo.FixedMsgVo;
import com.woniu.outlet.mysql.po.Notice;
import com.woniu.utils.ApplicationContextHolder;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class AddNoticeCommand {
    private String flag;
    private Integer userId;
    private FixedMsgVo fixedMsgVo;//基金、黄金定投接受对象
    private BigDecimal money;//定投交易金额
    private AddNoticeCommandHandle handle;

    public AddNoticeCommand() {
        this.handle = ApplicationContextHolder.getApplicationContext().getBean(AddNoticeCommandHandle.class);
    }

    public AddNoticeCommand(String flag, Integer userId, BigDecimal money, FixedMsgVo fixedMsgVo) {
        this();
        this.flag = flag;
        this.userId = userId;
        this.fixedMsgVo = fixedMsgVo;
        this.money = money;

    }

    public void excute() {
        handle.addNotice(this);
    }

}

